package com.facebank.usersupport.mapper.usersupport.usersupport;

import com.facebank.usersupport.dto.AgentAssDto;
import com.facebank.usersupport.model.Associator;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface AssociatorMapper {
    int deleteByPrimaryKey(Long associatorId);

    int insert(Associator record);

    int insertSelective(Associator record);

    Associator selectByPrimaryKey(Long associatorId);

    int updateByPrimaryKeySelective(Associator record);

    int updateByPrimaryKey(Associator record);

    List<Associator> selectAssociatorList(@Param("associatorName") String associatorName,@Param("phone") String phone,
                                          @Param("status") Short status,@Param("startTime") Long startTime,@Param("endTime") Long endTime);

    int selectByAssociatorNameOrPhone(@Param("associatorName") String associatorName,@Param("phone") String phone);

    Associator selectAssocitorByName(String username);

    Integer checkPhone(String phone);


    List<Associator> selectAssAgentList(@Param("associatorName") String associatorName,@Param("phone") String phone,@Param("status") Short status,
                                        @Param("startTime") Long startTime,@Param("endTime") Long endTime,@Param("userId") Long userId);

    List<AgentAssDto> selectAgentAss(@Param("phone") String phone, @Param("startTime") Long startTime,
                                     @Param("endTime") Long endTime, @Param("userId") Long userId);


}